package Alarm;

import com.mnk.TCPsoketTest.R;

import dietAndroidClient.CalendarView;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;

public class NotificationStart extends Activity {

	
	public NotificationStart() {
		super();
		setDefault(Notification.DEFAULT_SOUND);
		Log.i("notificationstart","dddddddddddddddddddddddddd");
		
		// TODO Auto-generated constructor stub
	}

	private Button notiButton;
	private NotificationManager mNotificationManager;
	private static int MOOD_NOTIFICATIONS = R.layout.status_bar_notifications;
	
	
	 @Override
	  public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.calendarview);
	    
	    mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
		Log.i("notistart","runinggggggggggggg");
	 }
	 
	 private void setDefault(int defaults) {
		 Log.i("notistart","goodruninggggggggggggg");
	      // This method sets the defaults on the notification before posting it.
	      
	      // This is who should be launched if the user selects our notification.
	      PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
	              new Intent(this, CalendarView.class), 0);

	      // In this sample, we'll use the same text for the ticker and the expanded notification
	      CharSequence text = getText(R.string.status_bar_notifications_happy_message);
	      String systime = Integer.toString((int)System.currentTimeMillis()	);
	     
	      Log.i("notirun",systime);
	      final Notification notification = new Notification(
	              R.drawable.dieter_01,       // the icon for the status bar
	              text,                        // the text to display in the ticker
	              System.currentTimeMillis()); // the timestamp for the notification

	      
	     
	      
	      notification.setLatestEventInfo(
	              this,                        // the context to use
	              getText(R.string.status_bar_notifications_mood_title),
	                                           // the title for the notification
	              text,                        // the details to display in the notification
	              contentIntent);              // the contentIntent (see above)

	      notification.defaults = defaults;
	      
	      
	      mNotificationManager.notify(
	                 R.layout.status_bar_notifications, // we use a string id because it is a unique
	                                                    // number.  we use it later to cancel the
	                 notification);                     // notification
	  }
}
